import { styled } from 'styled-components';

/** 拖拽元素样式 */
export const DragElementLayout = styled.div`
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  width: calc(50% - 16px);
  line-height: 32px;
  margin: 0 8px 16px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid #ebebeb;
  background: #ecf3fd;
  user-select: none;
  opacity: 1;

  &.is-block {
    width: 100%;
    flex: 0 0 calc(100% - 16px);
  }

  &.is-dragging {
    border-color: #415fff;
    opacity: 0.3;
  }

  &:hover {
    border-color: #415fff;
    cursor: move;
  }
`;

/** 释放区样式 */
export const DropElementLayout = styled.div`
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
  min-height: 85px;
  overflow: hidden;
  border: 1px solid #f0f0f0;
  border-radius: 4px;
  background-color: #fff;

  &.can-drop {
    border-color: #415fff;
    background-color: rgba(65, 95, 255, 0.3);
    &.is-active {
      border-color: #00c184;
      background-color: rgba(0, 193, 132, 0.3);
    }
  }

  .drop-title {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    height: 32px;
    line-height: 32px;
    padding: 0 10px;
    border-bottom: 1px solid #f0f0f0;
    background: #f6f6f6;
  }
  .drop-content {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }
`;

/** 释放元素样式 */
export const DropElementItemLayout = styled.div`
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 0 0 auto;
  width: calc(50% - 16px);
  height: 32px;
  line-height: 32px;
  margin: 8px;
  padding: 0 8px;
  overflow: hidden;
  border: 1px solid #dedede;
  border-radius: 4px;
  background-color: #fff;

  &:first-child {
    margin-bottom: 0;
  }

  .anticon {
    padding-left: 0;
  }

  .drop-item-name {
    display: flex;
    flex: 0 0 25%;
  }
  .drop-item-content {
    display: flex;
    flex: 0 0 50%;
  }
  .drop-item-operate {
    display: flex;
    flex: 0 0 25%;
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: center;
    padding-left: 8px;
    .drop-item-action {
      float: right;
    }
  }
  .anticon.anticon-close {
    display: inline-block;
    margin-left: 8px;
    font-size: 12px;
  }

  .ant-select.chart-type-select {
    width: 100%;
    .ant-select-selector {
      border: none;
    }
  }

  /** 颜色选择器 */
  .colorLabel {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translate(0, -50%);
    display: block;
    width: 12px;
    height: 12px;
  }
`;
